package com.ruoyi.postulant.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.postulant.mapper.ApplyMapper;
import com.ruoyi.postulant.domain.Apply;
import com.ruoyi.postulant.service.IApplyService;

/**
 * 活动报名Service业务层处理
 *
 * @author wanghong
 * @date 2025-03-15
 */
@Service
public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements IApplyService
{
    @Autowired
    private ApplyMapper applyMapper;

    /**
     * 查询活动报名
     *
     * @param id 活动报名主键
     * @return 活动报名
     */
    @Override
    public Apply selectApplyById(Integer id)
    {
        return applyMapper.selectApplyById(id);
    }

    /**
     * 查询活动报名列表
     *
     * @param apply 活动报名
     * @return 活动报名
     */
    @Override
    public List<Apply> selectApplyList(Apply apply)
    {
        return applyMapper.selectApplyList(apply);
    }

    /**
     * 新增活动报名
     *
     * @param apply 活动报名
     * @return 结果
     */
    @Override
    public int insertApply(Apply apply)
    {
        apply.setCreateTime(DateUtils.getNowDate());
        return applyMapper.insertApply(apply);
    }

    /**
     * 修改活动报名
     *
     * @param apply 活动报名
     * @return 结果
     */
    @Override
    public int updateApply(Apply apply)
    {
        apply.setUpdateTime(DateUtils.getNowDate());
        return applyMapper.updateApply(apply);
    }

    /**
     * 批量删除活动报名
     *
     * @param ids 需要删除的活动报名主键
     * @return 结果
     */
    @Override
    public int deleteApplyByIds(Integer[] ids)
    {
        return applyMapper.deleteApplyByIds(ids);
    }

    /**
     * 删除活动报名信息
     *
     * @param id 活动报名主键
     * @return 结果
     */
    @Override
    public int deleteApplyById(Integer id)
    {
        return applyMapper.deleteApplyById(id);
    }
}
